# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=alkimia
pkgver=8.1.1
pkgrel=0
# armhf blocked by qt5-qtdeclarative
# armhf, ppc64le, riscv64, s390x blocked by qt5-qtwebengine
# s390x and riscv64 blocked by polkit -> kio
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://community.kde.org/Alkimia/libalkimia"
pkgdesc="A library with common classes and functionality used by finance applications for the KDE SC"
license="GPL-3.0-or-later"
makedepends="
	doxygen
	extra-cmake-modules
	gmp-dev
	graphviz
	kcompletion-dev
	kconfig-dev
	kcoreaddons-dev
	kdelibs4support-dev
	kdoctools-dev
	ki18n-dev
	kiconthemes-dev
	kinit-dev
	kio-dev
	kitemmodels-dev
	knewstuff-dev
	kpackage-dev
	ktextwidgets-dev
	plasma-framework-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtwebengine-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/alkimia/$pkgver/alkimia-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_WITH_WEBKIT=OFF \
		-DBUILD_WITH_WEBENGINE=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E 'alkonlinequotestest'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3e96f5b32da3d8a7f23b3b0f0a0ba7923e472b972c06b35f918c7f00d1745fa747afb6b8fdc1d596b2c1d9757a8037de04a039047f47eb46383070721da05258  alkimia-8.1.1.tar.xz
"
